package com.it.spirngbootmybatis.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;


@Component
public class RedisConfig {

    @Autowired
    private StringRedisTemplate redisTemplate;


    public void setKey(String key, String value) {
        redisTemplate.boundValueOps(key).set(value);
    }

    public String getKey(String key) {
        return redisTemplate.boundValueOps(key).get();
    }
}
